import fetch from 'common/src/utils/fetch'


/**
 * 删除
 */
function delete_(roundId, teachingClassIds) {
    return fetch({
        url: `/api/electionservice/elcMutualRoundCourse/${roundId}`,
        method: 'delete',
        data: teachingClassIds
    });
}

/**
 * 删除全部
 */
function deleteAll(roundId) {
    return fetch({
        url: `/api/electionservice/elcMutualRoundCourse/deleteAll/${roundId}`,
        method: 'delete'
    });
}

/**
 * 新增
 */
function add(roundId, teachingClassIds) {
    return fetch({
        url: `/api/electionservice/elcMutualRoundCourse/${roundId}`,
        method: 'put',
        data: teachingClassIds
    });
}
/**
 * 添加全部
 * @param {} condition 
 */
function addAll(condition) {
    return fetch({
        url: '/api/electionservice/elecRoundCourse/addAll',
        method: 'put',
        data: condition
    });
}

/**
 * 分页查询已添加课程信息
 */
function searchList(data) {
    return fetch({
        url: '/api/electionservice/elecRoundCourse/page',
        method: 'post',
        data: data
    });
}

/**
 * 分页查询未添加课程信息
 */
function searchUnAddList(data) {
    return fetch({
        url: '/api/electionservice/elecRoundCourse/pageUnAdd',
        method: 'post',
        data: data
    });
}


export default {
    "delete_": delete_,
    "deleteAll": deleteAll,
    "add": add,
    "addAll": addAll,
    "searchList": searchList,
    "searchUnAddList": searchUnAddList
}